package com.pingbu.tijian.hospital.backapi.api;

import com.github.pagehelper.PageInfo;
import com.pingbu.common.bean.ResultBean;
import com.pingbu.tijian.hospital.backapi.bean.entity.StudentZuoye;
import com.pingbu.tijian.hospital.backapi.service.StudentService;
import com.pingbu.tijian.hospital.backapi.service.StudentZuoyeService;
import com.pingbu.tijian.hospital.backapi.service.StudentZuoyeStatistService;
import com.pingbu.tijian.hospital.backapi.service.UserInfoService;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/index_statist")
public class IndexStatistController {

    private static Logger logger = LoggerFactory.getLogger(IndexStatistController.class);

    @Autowired
    private StudentZuoyeStatistService studentZuoyeStatistService;

    /**
     * 获取布置作业的数量
     * @return
     */
    @PostMapping(value = "/get_buzhi_zuoye_count")
    public ResultBean<Integer> get_buzhi_zuoye_count(  ) {
        ResultBean<Integer> rb1 = studentZuoyeStatistService.getAllBuzhiZuoyeCount();
        return rb1;
    }

    /**
     * 获取学生的数量
     * @return
     */
    @PostMapping(value = "/get_student_count")
    public ResultBean<Integer> get_student_count(  ) {
        ResultBean<Integer> rb1 = studentZuoyeStatistService.getStudentCount();
        return rb1;
    }

    @PostMapping(value = "/get_pie1_data")
    public ResultBean<List<Map>> get_pie1_data(  ) {
        ResultBean<List<Map>> rb1 = studentZuoyeStatistService.getPie1Data();
        return rb1;
    }


}
